package com.xysoft.model;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity
public class User extends DataEntityImpl{
	private String username;
	private String password;
	private boolean enabled;
	private String truename;
	private String nickName;
	private SystemType systemType;
	private int sex;
	private Date birthday;
	private String mail;
	private String phone;
	private Date registerDate;
	private String ip;
	private Date lastTime;
	private boolean front;
	private String motto;
	private String qq;
	private String remark;
	private boolean limited;
	private Organization organization;
	private Set<UserAction> userActions;
	private Set<UserRole> userRoles;
	//实名认证(0.未认证; 1.已认证; 2.认证中;)
	private int reals;
	//身份认证(0.未认证; 1.已认证; 2.认证中;)
	private int status;
	//是否有图片
	private boolean pic;
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "organizationID")
	public Organization getOrganization() {
		return organization;
	}
	public void setOrganization(Organization organization) {
		this.organization = organization;
	}
	@OneToMany(mappedBy="user", fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
	public Set<UserAction> getUserActions() {
		return userActions;
	}
	public void setUserActions(Set<UserAction> userActions) {
		this.userActions = userActions;
	}
	@OneToMany(mappedBy="user", fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
	public Set<UserRole> getUserRoles() {
		return userRoles;
	}
	public void setUserRoles(Set<UserRole> userRoles) {
		this.userRoles = userRoles;
	}
	public String getTruename() {
		return truename;
	}
	public void setTruename(String truename) {
		this.truename = truename;
	}
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public Date getLastTime() {
		return lastTime;
	}
	public void setLastTime(Date lastTime) {
		this.lastTime = lastTime;
	}
	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="systemTypeID")
	public SystemType getSystemType() {
		return systemType;
	}
	public void setSystemType(SystemType systemType) {
		this.systemType = systemType;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getMail() {
		return mail;
	}
	public void setMail(String mail) {
		this.mail = mail;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public Date getRegisterDate() {
		return registerDate;
	}
	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}
	public boolean isEnabled() {
		return enabled;
	}
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}
	public int getSex() {
		return sex;
	}
	public void setSex(int sex) {
		this.sex = sex;
	}
	public boolean isFront() {
		return front;
	}
	public void setFront(boolean front) {
		this.front = front;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getMotto() {
		return motto;
	}
	public void setMotto(String motto) {
		this.motto = motto;
	}
	public String getQq() {
		return qq;
	}
	public void setQq(String qq) {
		this.qq = qq;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public boolean isLimited() {
		return limited;
	}
	public void setLimited(boolean limited) {
		this.limited = limited;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public int getReals() {
		return reals;
	}
	public void setReals(int reals) {
		this.reals = reals;
	}
	public boolean isPic() {
		return pic;
	}
	public void setPic(boolean pic) {
		this.pic = pic;
	}
}
